#include <mask.h>

// define layer structure and use it by calling the function [setlayers()] at beginning.
const int LSI=1;
#define EPS1 1e-9

//Configure layer stack.
struct Layer LayerStack[] = { 
{LSI , "LSI", AQUA, VISIBLE, EPS1},  
END_LAYERS //required to end the definition
};

/* The access waveguides design */
void access_waveguides(void) {
	push_cp();
	offset(-3e-6);
	cw(500e-6,-RAD(20),2e-6); /* One branch */
	cw(500e-6,RAD(20),2e-6);
	sw(1000e-6,2e-6);
	pop_cp();
	offset(3e-6);
	cw(500e-6,RAD(20),2e-6); /* The other branch */
	cw(500e-6,-RAD(20),2e-6);
	sw(1000e-6,2e-6);
}
/* The MMI design */
int main(void) {
  
  //use self-defined layer stack.
  setlayers(LayerStack);

	setfont((char *)"../../src/caps.plf");
  
	msk_header("test.gds", "MMI_layout");
	
  //use 
  layer(LSI);
	
  window("MMI Coupler");
	org(4950e-6,5000e-6,0,NOFLIP);
	push_cp(); /* remember cp */
	sw(100e-6,18e-6); /* MMI section */
	access_waveguides();
	pop_cp(); /* back to start */
	rotate(RAD(180)); /* Turn around */
	access_waveguides();
	org(4800e-6,4860e-6,0,NOFLIP);
	textout("MY MMI with 18 |m width.", 50e-6); /* Some annotation */
	msk_trailer();
}
